class Panel {
    score = 0;
    level = 1;
    maxLevel: number;
    upScore: number;

    scoreEle: HTMLElement;
    levelEle: HTMLElement;

    constructor(maxLevel:number = 10, upScore: number = 1) {
        this.scoreEle = document.getElementById('score')!;
        this.levelEle = document.getElementById('level')!;
        this.maxLevel = maxLevel;
        this.upScore = upScore;
    }

    addScore() {
        this.score += 1;
        this.scoreEle.innerHTML = String(this.score);
        if (this.score % this.maxLevel == 0) {
            this.addLevel()
        }
    }

    addLevel() {
        this.level += 1
        this.levelEle.innerHTML = String(this.level);
    }
}
 export default Panel